<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
            <el-col :span="24" >
                <el-form-item  label="账单编号"
 prop="billNo" >
                        <p>{{dataForm.billNo}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="支付交易代码"
 prop="paymentCode" >
                        <p>{{dataForm.paymentCode}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="付款类型"
 prop="paymentType" >
                         <p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="付款账号"
 prop="paymentAccount" >
                        <p>{{dataForm.paymentAccount}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="付款时间"
 prop="paymentTime" >
                        <p>{{jnpf.toDate(dataForm.paymentTime,"yyyy-MM-dd")}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="付款金额"
 prop="paymentAmount" >
                        <p>{{dataForm.paymentAmount}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="滞纳金"
 prop="lateFee" >
                        <p>{{dataForm.lateFee}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="支付人"
 prop="paymentUser" >
                        <p>{{dataForm.paymentUser}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="24" >
                <el-form-item  label="状态"
 prop="status" >
                         <p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
                </el-form-item>
            </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            billNo : '',
                            paymentCode : '',
                            paymentType : "",
                            paymentAccount : '',
                            paymentTime : '',
                            paymentAmount : '',
                            lateFee : '',
                            paymentUser : '',
                            status : "",
            },
                                paymentTypeOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
                                statusOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],

        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                        _dataAll.paymentType = _dataAll.paymentType ? JSON.parse( _dataAll.paymentType):[]
                        _dataAll.status = _dataAll.status ? JSON.parse( _dataAll.status):[]
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/Zcgl_cw_zfjl/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
